home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Maximum CD 2000 November
/
Maximum CD 2000 Nov.iso
/
AofE-Conquerers
/
age2xtrial.exe
/
CABFILE
/
MSGAME.CAB
/
Data
/
gamedata_x1.drs
/
Unnamed File 000031.bina
< prev
Wrap
Text File
|
2000-07-18
|
52KB
|
2,582 lines
;goals 1 and 2 = boats
;goal 3 = groups
;goal combat-arm = his unique unit type (also loads correct upgrades)
;goal 36 = good infantry -- 36 NO = don't build, YES = build,
; 2 = only build if we don't have a castle.
;goal 37 = good cavalry
;goal 38 = good horse-archers
;goal 39 = good archers
;starting goals
(defrule
(true)
=>
(set-goal military-parity NO) ;goal 3
(set-goal attack-control NO) ;goal 4
(set-goal need-deathmatch-villagers NO) ;goal 7
(set-goal secondary-build YES) ;goal 8
(set-goal soldiers-available NO);goal 10
(set-goal combat-supp NO) ;goal 12
(set-goal attack-enabled YES) ;goal 13
(set-goal age-advancement NO) ;goal 14
(set-goal make-warboat NO) ;goal 15
(disable-self)
)
;note that goal "enemy-soldiers" is, in wonder-kill, the siege-building goal.
(defrule
(true)
=>
(set-goal upgrade-conflict NO) ;goal 16
(set-goal pre-unique-arm NO) ;goal 17
(set-goal sea-owner NO) ;goal 23
(set-goal siege-available YES) ;goal 34
(disable-self)
)
(defrule
(strategic-number sn-number-explore-groups != 1)
=>
(set-strategic-number sn-number-explore-groups 1)
)
;which side are we?
(defrule
(cc-players-building-type-count any-enemy wonder > 0)
=>
(set-goal wonder-attempt ATTACK)
(enable-timer t-production 60)
(disable-self)
)
(defrule
(building-type-count wonder > 0)
=>
(set-goal wonder-attempt DEFEND)
(enable-timer t-production 60)
(disable-self)
)
;***************************************************
(defrule
(building-type-count-total castle == 0)
=>
(set-strategic-number sn-wood-gatherer-percentage 25)
(set-strategic-number sn-food-gatherer-percentage 25)
(set-strategic-number sn-gold-gatherer-percentage 25)
(set-strategic-number sn-stone-gatherer-percentage 25)
)
(defrule
(goal wonder-attempt ATTACK)
(building-type-count-total castle > 0)
=>
(set-strategic-number sn-wood-gatherer-percentage 30)
(set-strategic-number sn-food-gatherer-percentage 30)
(set-strategic-number sn-gold-gatherer-percentage 35)
(set-strategic-number sn-stone-gatherer-percentage 5)
)
(defrule
(goal wonder-attempt DEFEND)
(building-type-count-total castle > 0)
=>
(set-strategic-number sn-wood-gatherer-percentage 30)
(set-strategic-number sn-food-gatherer-percentage 30)
(set-strategic-number sn-gold-gatherer-percentage 30)
(set-strategic-number sn-stone-gatherer-percentage 10)
)
;***************************************************
(defrule
(difficulty == hardest)
(goal wonder-attempt ATTACK)
=>
(cc-add-resource wood 10000)
(cc-add-resource food 10000)
(cc-add-resource gold 10000)
(cc-add-resource stone 10000)
(disable-self)
)
(defrule
(difficulty == hard)
(goal wonder-attempt ATTACK)
=>
(cc-add-resource wood 5000)
(cc-add-resource food 5000)
(cc-add-resource gold 5000)
(cc-add-resource stone 5000)
(disable-self)
)
(defrule
(difficulty == moderate)
(goal wonder-attempt ATTACK)
=>
(cc-add-resource wood 1000)
(cc-add-resource food 1500)
(cc-add-resource gold 1500)
(cc-add-resource stone 1000)
(disable-self)
)
(defrule
(difficulty == hardest)
(goal wonder-attempt DEFEND)
=>
(cc-add-resource wood 5000)
(cc-add-resource food 5000)
(cc-add-resource gold 5000)
(cc-add-resource stone 5000)
(disable-self)
)
(defrule
(difficulty == hard)
(goal wonder-attempt DEFEND)
=>
(cc-add-resource wood 1000)
(cc-add-resource food 1000)
(cc-add-resource gold 1000)
(cc-add-resource stone 1000)
(disable-self)
)
(defrule
(difficulty == moderate)
(goal wonder-attempt DEFEND)
=>
(cc-add-resource wood 500)
(cc-add-resource food 500)
(cc-add-resource gold 500)
(cc-add-resource stone 500)
(disable-self)
)
;***************************************************
(defrule
(difficulty <= moderate)
(building-type-count-total house <= fifteen-percent-pop)
(can-build house)
=>
(build house)
)
#load-if-defined DIFFICULTY-EASIEST
(defrule
(military-population < 10)
(housing-headroom < 5)
(population-headroom > 0)
(can-build house)
=>
(build house)
)
#end-if
#load-if-defined DIFFICULTY-EASY
(defrule
(military-population < civ-dark-rush)
(housing-headroom < 5)
(population-headroom > 0)
(can-build house)
=>
(build house)
)
#end-if
(defrule
(game-time < 900)
(building-type-count town-center == 0)
(can-build town-center)
=>
(build town-center)
)
(defrule
(building-type-count mining-camp == 0)
(resource-found gold)
(can-build mining-camp)
=>
(build mining-camp)
)
(defrule
(building-type-count mining-camp < 2)
(resource-found gold)
(resource-found stone)
(can-build mining-camp)
=>
(build mining-camp)
)
(defrule
(building-type-count lumber-camp == 0)
(can-build lumber-camp)
=>
(build lumber-camp)
)
;poor monks
(defrule
(military-population > thirty-percent-pop)
(unit-type-count-total monk == 0)
(can-train monk)
=>
(train monk)
)
;fair monks
(defrule
(military-population > thirty-percent-pop)
(unit-type-count-total monk <= five-percent-pop)
(goal monk-rating FAIR)
(can-train monk)
=>
(train monk)
)
;good monks
(defrule
(military-population > thirty-percent-pop)
(unit-type-count-total monk <= fifteen-percent-pop)
(goal monk-rating GOOD)
(not (civ-selected spanish) )
(can-train monk)
=>
(train monk)
)
;good monks
(defrule
(military-population > thirty-percent-pop)
(unit-type-count-total missionary <= fifteen-percent-pop)
(civ-selected spanish)
(can-train missionary)
=>
(train missionary)
)
(defrule
(goal wonder-attempt ATTACK)
(military-population > twenty-percent-pop)
(unit-type-count-total petard < 3)
(can-train petard)
=>
(train petard)
)
(defrule
(true)
=>
(set-goal combat-supp NO)
)
;*********************************************************
;production routine
(defrule
(unit-type-count-total battering-ram-line < 2)
(unit-type-count-total siege-onager < 2)
(unit-type-count-total trebuchet < 2)
(unit-type-count-total bombard-cannon < 2)
(unit-type-count-total elite-tarkan < 12)
(unit-type-count-total petard < 8)
(game-time > 300)
(wood-amount > 225)
(gold-amount > 225)
(not (goal siege-rating EXCELLENT) )
=>
(set-goal combat-supp FAIR)
(generate-random-number 20)
)
(defrule
(can-afford-unit galley)
(can-afford-unit teutonic-knight)
(can-afford-unit mameluke)
(nor
(goal siege-rating EXCELLENT)
(goal combat-supp FAIR)
)
=>
(generate-random-number 20)
(set-goal combat-supp YES)
)
(defrule
(goal siege-rating EXCELLENT)
(difficulty <= moderate)
(unit-type-count-total battering-ram-line < five-percent-pop)
(unit-type-count-total siege-onager < five-percent-pop)
(unit-type-count-total trebuchet < five-percent-pop)
(unit-type-count-total bombard-cannon < five-percent-pop)
(unit-type-count-total elite-tarkan < 12)
(unit-type-count-total petard < 8)
(wood-amount > 225)
(gold-amount > 225)
=>
(set-goal combat-supp FAIR)
(release-escrow wood)
(release-escrow gold)
(generate-random-number 20)
)
(defrule
(goal siege-rating EXCELLENT)
(difficulty >= easy)
(unit-type-count-total battering-ram-line < 2)
(unit-type-count-total siege-onager < 1)
(unit-type-count-total trebuchet < 1)
(unit-type-count-total bombard-cannon < 1)
(unit-type-count-total elite-tarkan < 6)
(unit-type-count-total petard < 4)
(wood-amount > 225)
(gold-amount > 225)
=>
(set-goal combat-supp FAIR)
(release-escrow wood)
(release-escrow gold)
(generate-random-number 20)
)
(defrule
(goal combat-supp FAIR)
(random-number <= 5)
(or
(or
(unit-type-count champion >= 6)
(unit-type-count elite-eagle-warrior >= 6)
)
(or
(unit-type-count spearman-line >= 6)
(unit-type-count elite-jaguar-man >= 6)
)
)
(not (cc-players-building-type-count every-enemy bombard-tower > 0) )
(can-train battering-ram-line)
=>
(train battering-ram-line)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp FAIR)
(random-number <= 5)
(or
(or
(unit-type-count elite-teutonic-knight >= 6)
(unit-type-count elite-throwing-axeman >= 6)
)
(or
(unit-type-count elite-woad-raider >= 6)
(unit-type-count elite-huskarl >= 6)
)
)
(not (cc-players-building-type-count every-enemy bombard-tower > 0) )
(can-train battering-ram-line)
=>
(train battering-ram-line)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp FAIR)
(random-number <= 5)
(or
(unit-type-count elite-berserk >= 6)
(unit-type-count elite-samurai >= 6)
)
(not (cc-players-building-type-count every-enemy bombard-tower > 0) )
(can-train battering-ram-line)
=>
(train battering-ram-line)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp FAIR)
(random-number <= 10)
(can-train siege-onager)
=>
(train siege-onager)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp FAIR)
(random-number <= 15)
(can-train bombard-cannon)
=>
(train bombard-cannon)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp FAIR)
(random-number <= 20)
=>
(train trebuchet)
(set-goal combat-supp NO)
)
;what if we're poor & need troops?
(defrule
(or
(and
(goal siege-rating EXCELLENT)
(goal combat-supp NO)
)
(goal wonder-attempt DEFEND)
)
(timer-triggered t-production)
(can-afford-unit galley)
(can-afford-unit teutonic-knight)
(can-afford-unit mameluke)
=>
(generate-random-number 20)
(set-goal combat-supp YES)
)
;*********************************************************
;*********************************************************
#load-if-defined AZTEC-CIV
;train jaguar men, eagle men, champs, arbalests, siege-ram, siege-onager
(defrule
(true)
=>
(set-goal monk-rating GOOD)
(set-goal siege-rating FAIR)
(disable-self)
)
(defrule
(goal combat-supp YES)
(random-number <= 8)
(or
(or
(cc-players-unit-type-count any-enemy champion > 6)
(cc-players-unit-type-count any-enemy elite-berserk > 6)
)
(or
(cc-players-unit-type-count any-enemy elite-samurai > 6)
(cc-players-unit-type-count any-enemy elite-teutonic-knight > 6)
)
)
(can-train elite-jaguar-man)
=>
(train elite-jaguar-man)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 8)
(or
(or
(cc-players-unit-type-count any-enemy elite-throwing-axeman > 6)
(cc-players-unit-type-count any-enemy elite-woad-raider > 6)
)
(or
(cc-players-unit-type-count any-enemy elite-huskarl > 6)
(cc-players-unit-type-count any-enemy elite-jaguar-man > 6)
)
)
(can-train elite-jaguar-man)
=>
(train elite-jaguar-man)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 12)
(can-train champion)
=>
(train champion)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 16)
(can-train elite-eagle-warrior)
=>
(train elite-eagle-warrior)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 20)
(can-train arbalest)
=>
(train arbalest)
(set-goal combat-supp NO)
)
#end-if
;*********************************************************
#load-if-defined HUN-CIV
;train tarkans, paladins, hussars, heavy cav archers
(defrule
(true)
=>
(set-goal monk-rating FAIR)
(set-goal siege-rating POOR)
(disable-self)
)
(defrule
(goal combat-supp YES)
(random-number <= 10)
(can-train elite-tarkan)
=>
(train elite-tarkan)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 14)
(can-train heavy-cavalry-archer)
=>
(train heavy-cavalry-archer)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 18)
(can-train paladin)
=>
(train paladin)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 20)
(can-train hussar)
=>
(train hussar)
(set-goal combat-supp NO)
)
#end-if
;*********************************************************
#load-if-defined KOREAN-CIV
;train war-wagons, hand-cannoneers, hussars, heavy cavalry archers, siege onagers
(defrule
(true)
=>
(set-goal monk-rating FAIR)
(set-goal siege-rating FAIR)
(disable-self)
)
(defrule
(goal combat-supp YES)
(random-number <= 10)
(not (can-train elite-war-wagon) )
(can-train-with-escrow elite-war-wagon)
=>
(release-escrow wood)
(release-escrow gold)
)
(defrule
(goal combat-supp YES)
(random-number <= 10)
(can-train elite-war-wagon)
=>
(train elite-war-wagon)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 12)
(can-train hand-cannoneer)
=>
(train hand-cannoneer)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 16)
(can-train heavy-cavalry-archer)
=>
(train heavy-cavalry-archer)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 20)
(can-train hussar)
=>
(train hussar)
(set-goal combat-supp NO)
)
#end-if
;*********************************************************
#load-if-defined MAYAN-CIV
;train plumed archers, elite-eagle-warriors, arbalests, siege rams
(defrule
(true)
=>
(set-goal monk-rating FAIR)
(set-goal siege-rating POOR)
(disable-self)
)
(defrule
(goal combat-supp YES)
(random-number <= 6)
(can-train elite-plumed-archer)
=>
(train elite-plumed-archer)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 10)
(can-train arbalest)
=>
(train arbalest)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 20)
(can-train elite-eagle-warrior)
=>
(train elite-eagle-warrior)
(set-goal combat-supp NO)
)
#end-if
;*********************************************************
#load-if-defined SPANISH-CIV
;train conquistadors, champs, paladins, hussars, handgunners, hvy cav archers,
;bombard cannons
(defrule
(true)
=>
(set-goal monk-rating GOOD)
(set-goal siege-rating FAIR)
(disable-self)
)
(defrule
(goal combat-supp YES)
(random-number <= 4)
(can-train elite-conquistador)
=>
(train elite-conquistador)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 6)
(can-train champion)
=>
(train champion)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 10)
(can-train paladin)
=>
(train paladin)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 12)
(can-train hussar)
=>
(train hussar)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 16)
(can-train hand-cannoneer)
=>
(train hand-cannoneer)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 20)
(can-train heavy-cavalry-archer)
=>
(train heavy-cavalry-archer)
(set-goal combat-supp NO)
)
#end-if
;*********************************************************
#load-if-defined BRITON-CIV
;train longbows, champs, hussar, arbalests
(defrule
(true)
=>
(set-goal monk-rating GOOD)
(set-goal siege-rating POOR)
(disable-self)
)
(defrule
(goal combat-supp YES)
(random-number <= 10)
(can-train elite-longbowman)
=>
(train elite-longbowman)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 12)
(can-train arbalest)
=>
(train arbalest)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 18)
(can-train champion)
=>
(train champion)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 20)
(can-train hussar)
=>
(train hussar)
(set-goal combat-supp NO)
)
#end-if
;*********************************************************
#load-if-defined BYZANTINE-CIV
;train cataphracts, champion, paladin, hussar, hand-cannoneer, heavy-cavalry-archer
;bombard cannon, siege ram
(defrule
(true)
=>
(set-goal monk-rating GOOD)
(set-goal siege-rating POOR)
(disable-self)
)
(defrule
(goal combat-supp YES)
(random-number <= 4)
(can-train elite-cataphract)
=>
(train elite-cataphract)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 6)
(can-train paladin)
=>
(train paladin)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 10)
(can-train champion)
=>
(train champion)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 14)
(can-train hand-cannoneer)
=>
(train hand-cannoneer)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 18)
(can-train heavy-cavalry-archer)
=>
(train heavy-cavalry-archer)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 20)
(can-train hussar)
=>
(train hussar)
(set-goal combat-supp NO)
)
#end-if
;************************************************
#load-if-defined CELTIC-CIV
;train woad raiders, champion, paladin, hand-cannoneer, siege-ram, siege-onager, heavy-scorpion
(defrule
(true)
=>
(set-goal monk-rating POOR)
(set-goal siege-rating GOOD)
(disable-self)
)
(defrule
(goal combat-supp YES)
(random-number <= 6)
(can-train elite-woad-raider)
=>
(train elite-woad-raider)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 8)
(can-train champion)
=>
(train champion)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 12)
(can-train heavy-scorpion)
=>
(train heavy-scorpion)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 16)
(can-train paladin)
=>
(train paladin)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 20)
(can-train hand-cannoneer)
=>
(train hand-cannoneer)
(set-goal combat-supp NO)
)
#end-if
;********************************
#load-if-defined CHINESE-CIV
;train chu-ko-nu, heavy scorpion, champs, arbalest,
; heavy-cavalry-archer, siege-ram
(defrule
(true)
=>
(set-goal monk-rating FAIR)
(set-goal siege-rating POOR)
(disable-self)
)
(defrule
(goal combat-supp YES)
(random-number <= 8)
(can-train elite-chu-ko-nu)
=>
(train elite-chu-ko-nu)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 12)
(can-train heavy-scorpion)
=>
(train heavy-scorpion)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 16)
(can-train champion)
=>
(train champion)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 18)
(can-train arbalest)
=>
(train arbalest)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 20)
(can-train heavy-cavalry-archer)
=>
(train heavy-cavalry-archer)
(set-goal combat-supp NO)
)
#end-if
;*******************************
#load-if-defined FRANKISH-CIV
;train throwing-axe, champions, paladins, hand-cannoneer, bombard-cannon
(defrule
(true)
=>
(set-goal monk-rating FAIR)
(set-goal siege-rating FAIR)
(disable-self)
)
(defrule
(goal combat-supp YES)
(random-number <= 4)
(can-train elite-throwing-axeman)
=>
(train elite-throwing-axeman)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 5)
(can-train champion)
=>
(train champion)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 15)
(can-train paladin)
=>
(train paladin)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 20)
(can-train hand-cannoneer)
=>
(train hand-cannoneer)
(set-goal combat-supp NO)
)
#end-if
;****************************
#load-if-defined GOTHIC-CIV
;train huskarls, champion, hussar, hand-cannoneer, bombard-cannon
(defrule
(true)
=>
(set-goal monk-rating POOR)
(set-goal siege-rating POOR)
(disable-self)
)
(defrule
(goal combat-supp YES)
(random-number <= 10)
(or
(or
(cc-players-unit-type-count any-enemy arbalest > 6)
(cc-players-unit-type-count any-enemy heavy-cavalry-archer > 6)
)
(or
(cc-players-unit-type-count any-enemy hand-cannoneer > 6)
(cc-players-unit-type-count any-enemy elite-chu-ko-nu > 6)
)
)
(can-train elite-huskarl)
=>
(train elite-huskarl)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 10)
(or
(or
(cc-players-unit-type-count any-enemy elite-janissary > 6)
(cc-players-unit-type-count any-enemy elite-longbowman > 6)
)
(or
(cc-players-unit-type-count any-enemy elite-mangudai > 6)
(cc-players-unit-type-count any-enemy elite-plumed-archer > 6)
)
)
(can-train elite-huskarl)
=>
(train elite-huskarl)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 10)
(or
(cc-players-unit-type-count any-enemy elite-conquistador > 6)
(cc-players-unit-type-count any-enemy elite-war-wagon > 6)
)
(can-train elite-huskarl)
=>
(train elite-huskarl)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 12)
(can-train champion)
=>
(train champion)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 14)
(can-train hussar)
=>
(train hussar)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 20)
(can-train hand-cannoneer)
=>
(train hand-cannoneer)
(set-goal combat-supp NO)
)
#end-if
;********************************
#load-if-defined JAPANESE-CIV
;train samurai, champion, heavy-scorpion, hand-cannoneer, heavy-cavalry-archer
(defrule
(true)
=>
(set-goal monk-rating GOOD)
(set-goal siege-rating GOOD)
(disable-self)
)
(defrule
(goal combat-supp YES)
(random-number <= 8)
(can-train elite-samurai)
=>
(train elite-samurai)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 10)
(can-train champion)
=>
(train champion)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 14)
(can-train heavy-scorpion)
=>
(train heavy-scorpion)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 16)
(can-train hand-cannoneer)
=>
(train hand-cannoneer)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 20)
(can-train heavy-cavalry-archer)
=>
(train heavy-cavalry-archer)
(set-goal combat-supp NO)
)
#end-if
;*********************************
#load-if-defined MONGOL-CIV
;trains mangudai, champs, hussars, arbalests, heavy-cavalry-archers
;siege-ram, siege-onager, heavy-scorpion
(defrule
(true)
=>
(set-goal monk-rating POOR)
(set-goal siege-rating GOOD)
(disable-self)
)
(defrule
(goal combat-supp YES)
(random-number <= 8)
(can-train elite-mangudai)
=>
(train elite-mangudai)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 10)
(can-train heavy-cavalry-archer)
=>
(train heavy-cavalry-archer)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 12)
(can-train heavy-scorpion)
=>
(train heavy-scorpion)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 15)
(can-train hussar)
=>
(train hussar)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 17)
(can-train arbalest)
=>
(train arbalest)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 20)
(can-train champion)
=>
(train champion)
(set-goal combat-supp NO)
)
#end-if
;***********************************
#load-if-defined PERSIAN-CIV
;trains elephants, paladin, hussar, hand-cannoneer, heavy-cavalry-archer, bombard-cannon
(defrule
(true)
=>
(set-goal monk-rating POOR)
(set-goal siege-rating POOR)
(disable-self)
)
(defrule
(goal combat-supp YES)
(random-number <= 10)
(not (can-train elite-war-elephant) )
(can-train-with-escrow elite-war-elephant)
=>
(release-escrow food)
(release-escrow gold)
)
(defrule
(goal combat-supp YES)
(random-number <= 10)
(can-train elite-war-elephant)
=>
(train elite-war-elephant)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 12)
(can-train paladin)
=>
(train paladin)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 14)
(can-train hussar)
=>
(train hussar)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 16)
(can-train hand-cannoneer)
=>
(train hand-cannoneer)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 20)
(can-train heavy-cavalry-archer)
=>
(train heavy-cavalry-archer)
(set-goal combat-supp NO)
)
#end-if
;***********************************
#load-if-defined SARACEN-CIV
;trains mamluks, champions, hussar, arbalest, heavy-cavalry-archer
;bombard-cannon, siege-ram, siege-onager
(defrule
(true)
=>
(set-goal monk-rating GOOD)
(set-goal siege-rating FAIR)
(disable-self)
)
(defrule
(goal combat-supp YES)
(random-number <= 6)
(can-train elite-mameluke)
=>
(train elite-mameluke)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 10)
(can-train heavy-cavalry-archer)
=>
(train heavy-cavalry-archer)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 12)
(can-train hussar)
=>
(train hussar)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 16)
(can-train arbalest)
=>
(train arbalest)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 20)
(can-train champion)
=>
(train champion)
(set-goal combat-supp NO)
)
#end-if
;*********************************
#load-if-defined TEUTONIC-CIV
;trains TK, champion, paladin, hand-cannoneer, bombard-cannon, siege-onager
(defrule
(true)
=>
(set-goal monk-rating GOOD)
(set-goal siege-rating FAIR)
(disable-self)
)
(defrule
(goal combat-supp YES)
(random-number <= 8)
(can-train elite-teutonic-knight)
=>
(train elite-teutonic-knight)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 12)
(can-train paladin)
=>
(train paladin)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 16)
(can-train champion)
=>
(train champion)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 20)
(can-train hand-cannoneer)
=>
(train hand-cannoneer)
(set-goal combat-supp NO)
)
#end-if
;************************************
#load-if-defined TURKISH-CIV
;trains janissaries, champion, hussar, hand-cannoneer, bombard-cannon
(defrule
(true)
=>
(set-goal monk-rating FAIR)
(set-goal siege-rating GOOD)
(disable-self)
)
(defrule
(goal combat-supp YES)
(random-number <= 10)
(can-train elite-janissary)
=>
(train elite-janissary)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 12)
(can-train hand-cannoneer)
=>
(train hand-cannoneer)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 18)
(can-train champion)
=>
(train champion)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 20)
(can-train hussar)
=>
(train hussar)
(set-goal combat-supp NO)
)
#end-if
;********************************
#load-if-defined VIKING-CIV
;trains berserks, champion, arbalest, siege-ram
(defrule
(true)
=>
(set-goal monk-rating POOR)
(set-goal siege-rating FAIR)
(disable-self)
)
(defrule
(goal combat-supp YES)
(random-number <= 12)
(can-train elite-berserk)
=>
(train elite-berserk)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 14)
(can-train champion)
=>
(train champion)
(set-goal combat-supp NO)
)
(defrule
(goal combat-supp YES)
(random-number <= 20)
(can-train arbalest)
=>
(train arbalest)
(set-goal combat-supp NO)
)
#end-if
;*********************************************************
;who will be the siege meister?
(defrule
(difficulty <= moderate)
(taunt-detected any-ally 230)
=>
(set-goal siege-rating NO)
(acknowledge-taunt this-any-ally 230)
(disable-self)
)
(defrule
(goal siege-rating GOOD)
(difficulty <= moderate)
(game-time >= 10)
(player-computer any-ally)
=>
(set-goal siege-rating EXCELLENT)
(chat-to-player-using-id every-ally 22409) ;230
(disable-self)
)
(defrule
(goal siege-rating FAIR)
(difficulty <= moderate)
(game-time >= 30)
(player-computer any-ally)
=>
(set-goal siege-rating EXCELLENT)
(chat-to-player-using-id every-ally 22409) ;230
(disable-self)
)
(defrule
(goal siege-rating POOR)
(difficulty <= moderate)
(game-time >= 50)
(player-computer any-ally)
=>
(set-goal siege-rating EXCELLENT)
(chat-to-player-using-id every-ally 22409) ;230
(disable-self)
)
(defrule
(goal wonder-attempt DEFEND)
(not (goal siege-rating NO) )
=>
(set-goal siege-rating NO)
)
(defrule
(true)
=>
(set-escrow-percentage wood 40)
(set-escrow-percentage food 0)
(set-escrow-percentage gold 40)
(set-escrow-percentage stone 0)
(disable-self)
)
(defrule
(goal siege-rating EXCELLENT)
=>
(set-escrow-percentage wood 70)
(set-escrow-percentage gold 70)
(disable-self)
)
(defrule
(civ-selected persian)
=>
(set-escrow-percentage food 40)
(disable-self)
)
;***************************************************
;restart emergency production timer
(defrule
(timer-triggered t-production)
=>
(disable-timer t-production)
(enable-timer t-production 60)
)
;*********************************************************
#load-if-defined DIFFICULTY-EASIEST
(defrule
(true)
=>
(set-strategic-number sn-percent-enemy-sighted-response 10)
(set-strategic-number sn-consecutive-idle-unit-limit 60)
(set-strategic-number sn-easiest-reaction-percentage 20)
(set-difficulty-parameter ability-to-maintain-distance 100)
(set-difficulty-parameter ability-to-dodge-missiles 100)
(disable-self)
)
#end-if
;********************************
#load-if-defined DIFFICULTY-EASY
(defrule
(true)
=>
(set-strategic-number sn-percent-enemy-sighted-response 25)
(set-strategic-number sn-consecutive-idle-unit-limit 20)
(set-strategic-number sn-easier-reaction-percentage 20)
(set-strategic-number sn-hits-before-alliance-change 50)
(set-difficulty-parameter ability-to-maintain-distance 75)
(set-difficulty-parameter ability-to-dodge-missiles 75)
(disable-self)
)
#end-if
;********************************
#load-if-defined DIFFICULTY-MODERATE
(defrule
(true)
=>
(set-strategic-number sn-percent-enemy-sighted-response 75)
(set-strategic-number sn-consecutive-idle-unit-limit 5)
(set-strategic-number sn-hits-before-alliance-change 25)
(set-difficulty-parameter ability-to-maintain-distance 50)
(set-difficulty-parameter ability-to-dodge-missiles 50)
(disable-self)
)
#end-if
;********************************
#load-if-defined DIFFICULTY-HARD
(defrule
(true)
=>
(set-strategic-number sn-percent-enemy-sighted-response 99)
(set-strategic-number sn-consecutive-idle-unit-limit 1)
(set-strategic-number sn-hits-before-alliance-change 10)
(set-difficulty-parameter ability-to-maintain-distance 0)
(set-difficulty-parameter ability-to-dodge-missiles 0)
(disable-self)
)
#end-if
;********************************
#load-if-defined DIFFICULTY-HARDEST
(defrule
(true)
=>
(set-strategic-number sn-percent-enemy-sighted-response 99)
(set-strategic-number sn-consecutive-idle-unit-limit 1)
(set-strategic-number sn-hits-before-alliance-change 10)
(set-difficulty-parameter ability-to-maintain-distance 0)
(set-difficulty-parameter ability-to-dodge-missiles 0)
(disable-self)
)
(defrule
(true)
=>
(disable-timer t-chatmore)
(enable-timer t-chatmore 1200)
(disable-self)
)
(defrule
(timer-triggered t-chatmore)
=>
(cc-add-resource wood 500)
(cc-add-resource food 500)
(cc-add-resource gold 500)
(cc-add-resource stone 500)
(disable-timer t-chatmore)
(enable-timer t-chatmore 1200)
)
#end-if
;********************************
;********************************
(defrule
(true)
=>
(set-strategic-number sn-coop-share-information 1)
(set-strategic-number sn-coop-share-attacking 1)
(set-strategic-number sn-maximum-town-size imperial-town-size)
(set-strategic-number sn-task-ungrouped-soldiers 0)
(set-strategic-number sn-zero-priority-distance 250)
(set-strategic-number sn-blot-exploration-map 0)
(set-strategic-number sn-attack-intelligence 1)
(set-strategic-number sn-gather-defense-units 1)
(set-strategic-number sn-defense-distance 2)
(set-strategic-number sn-maximum-gaia-attack-response 1)
(set-strategic-number sn-ignore-attack-group-under-attack 1)
(set-strategic-number sn-allow-civilian-defense 0)
(disable-self)
)
(defrule
(true)
=>
(set-strategic-number sn-stone-dropsite-distance 3)
(set-strategic-number sn-gold-dropsite-distance 3)
(set-strategic-number sn-retask-gather-amount 20)
(set-strategic-number sn-camp-max-distance 15)
(set-strategic-number sn-mill-max-distance 15)
(set-strategic-number sn-enemy-sighted-response-distance 15)
(set-strategic-number sn-group-form-distance 10)
(set-strategic-number sn-town-defend-priority 7)
(set-strategic-number sn-gold-defend-priority 2)
(set-strategic-number sn-stone-defend-priority 3)
(set-strategic-number sn-forage-defend-priority 0)
(set-strategic-number sn-relic-defend-priority 0)
(disable-self)
)
(defrule
(true)
=>
(set-strategic-number sn-cap-civilian-gatherers 100)
(set-strategic-number sn-percent-civilian-gatherers 0)
(set-strategic-number sn-minimum-civilian-explorers 0)
(set-strategic-number sn-cap-civilian-explorers 0)
(set-strategic-number sn-percent-civilian-explorers 0)
(set-strategic-number sn-cap-civilian-builders 12)
(set-strategic-number sn-percent-civilian-builders 100)
(disable-self)
)
(defrule
(or
(building-type-count barracks > 0)
(or
(building-type-count stable > 0)
(building-type-count archery-range > 0)
)
)
=>
(set-strategic-number sn-percent-civilian-builders 15)
(set-strategic-number sn-percent-civilian-gatherers 85)
(disable-self)
)
(defrule
(strategic-number sn-percent-civilian-gatherers == 85)
(building-type-count castle > 0)
=>
(set-strategic-number sn-percent-civilian-builders 10)
(set-strategic-number sn-percent-civilian-gatherers 90)
(disable-self)
)
; villager count
(defrule
(can-train villager)
(civilian-population < 10)
=>
(train villager)
)
(defrule
(can-train villager)
(civilian-population < civ-castle)
(or
(or
(wood-amount < 1000)
(food-amount < 1000)
)
(or
(gold-amount < 1000)
(stone-amount < 1000)
)
)
=>
(train villager)
)
;*********************************
;buildings
(defrule
(difficulty <= moderate)
(housing-headroom < 5)
(population-headroom > 0)
(can-build house)
=>
(build house)
)
#load-if-defined DIFFICULTY-EASIEST
(defrule
(military-population < 10)
(housing-headroom < 5)
(population-headroom > 0)
(can-build house)
=>
(build house)
)
#end-if
#load-if-defined DIFFICULTY-EASY
(defrule
(military-population < civ-dark-rush)
(housing-headroom < 5)
(population-headroom > 0)
(can-build house)
=>
(build house)
)
#end-if
(defrule
(game-time < 900)
(building-type-count town-center < 3)
(can-build town-center)
=>
(build town-center)
)
(defrule
(building-type-count mining-camp == 0)
(resource-found gold)
(can-build mining-camp)
=>
(build mining-camp)
)
(defrule
(building-type-count mining-camp < 2)
(resource-found gold)
(resource-found stone)
(can-build mining-camp)
=>
(build mining-camp)
)
(defrule
(building-type-count lumber-camp == 0)
(can-build lumber-camp)
=>
(build lumber-camp)
)
(defrule
(game-time > 60)
(building-type-count-total market == 0)
(can-build market)
=>
(build market)
)
(defrule
(building-type-count castle == 0)
(can-build castle)
=>
(build castle)
)
(defrule
(building-type-count castle > 0)
(building-type-count castle < 4)
(can-build castle)
=>
(build-forward castle)
)
(defrule
(building-type-count-total siege-workshop == 0)
(can-build siege-workshop)
=>
(build siege-workshop)
)
(defrule
(building-type-count-total siege-workshop <= 1)
(goal siege-rating POOR)
(can-build siege-workshop)
=>
(build-forward siege-workshop)
)
(defrule
(building-type-count-total siege-workshop > 0)
(building-type-count-total siege-workshop <= 2)
(goal siege-rating FAIR)
(can-build siege-workshop)
=>
(build-forward siege-workshop)
)
(defrule
(building-type-count-total siege-workshop > 0)
(building-type-count-total siege-workshop <= 3)
(goal siege-rating GOOD)
(can-build siege-workshop)
=>
(build-forward siege-workshop)
)
(defrule
(building-type-count-total monastery == 0)
(can-build monastery)
=>
(build monastery)
)
(defrule
(building-type-count-total monastery <= 1)
(goal monk-rating FAIR)
(can-build monastery)
=>
(build monastery)
)
(defrule
(building-type-count-total monastery <= 2)
(goal monk-rating GOOD)
(can-build monastery)
=>
(build monastery)
)
(defrule
(building-type-count-total barracks == 0)
(nor
(civ-selected hun)
(or
(civ-selected korean)
(civ-selected persian)
)
)
(can-build barracks)
=>
(build barracks)
)
(defrule
(building-type-count-total barracks > 0)
(building-type-count-total barracks <= 2)
(or
(or
(civ-selected briton)
(civ-selected chinese)
)
(or
(civ-selected teutonic)
(civ-selected turkish)
)
)
(can-build barracks)
=>
(build-forward barracks)
)
(defrule
(building-type-count-total barracks > 0)
(building-type-count-total barracks <= 3)
(or
(or
(civ-selected aztec)
(civ-selected mayan)
)
(or
(civ-selected gothic)
(or
(civ-selected japanese)
(civ-selected viking)
)
)
)
(can-build barracks)
=>
(build-forward barracks)
)
(defrule
(building-type-count-total archery-range == 0)
(can-build archery-range)
=>
(build archery-range)
)
(defrule
(building-type-count-total archery-range == 1)
(can-build archery-range)
=>
(build-forward archery-range)
)
(defrule
(building-type-count-total archery-range > 0)
(building-type-count-total archery-range <= 2)
(or
(or
(civ-selected hun)
(civ-selected korean)
)
(or
(or
(civ-selected mayan)
(civ-selected spanish)
)
(or
(civ-selected briton)
(civ-selected chinese)
)
)
)
(can-build archery-range)
=>
(build-forward archery-range)
)
(defrule
(building-type-count-total archery-range > 0)
(building-type-count-total archery-range <= 3)
(or
(or
(civ-selected japanese)
(civ-selected mongol)
)
(or
(civ-selected persian)
(civ-selected viking)
)
)
(can-build archery-range)
=>
(build-forward archery-range)
)
(defrule
(building-type-count-total stable == 0)
(nor
(or
(civ-selected aztec)
(civ-selected mayan)
)
(or
(civ-selected chinese)
(or
(civ-selected japanese)
(civ-selected viking)
)
)
)
(can-build stable)
=>
(build stable)
)
(defrule
(building-type-count-total stable == 1)
(or
(or
(civ-selected briton)
(civ-selected byzantine)
)
(or
(or
(civ-selected celtic)
(civ-selected mongol)
)
(or
(civ-selected teutonic)
(civ-selected turkish)
)
)
)
(can-build stable)
=>
(build-forward stable)
)
(defrule
(building-type-count-total stable > 0)
(building-type-count-total stable <= 3)
(or
(or
(civ-selected hun)
(civ-selected spanish)
)
(or
(civ-selected frankish)
(civ-selected persian)
)
)
(can-build stable)
=>
(build-forward stable)
)
;***********************************
;MARKET STUFF
;***********************************
(defrule
(wood-amount > 500)
(or
(food-amount < 200)
(or
(gold-amount < 225)
(and
(goal wonder-attempt DEFEND)
(stone-amount < 125)
)
)
)
(can-sell-commodity wood)
=>
(chat-local-to-self "sell wood")
(sell-commodity wood)
)
(defrule
(food-amount > 500)
(or
(wood-amount < 225)
(or
(gold-amount < 225)
(and
(goal wonder-attempt DEFEND)
(stone-amount < 125)
)
)
)
(can-sell-commodity food)
=>
(chat-local-to-self "sell food")
(sell-commodity food)
)
(defrule
(stone-amount < 650)
(gold-amount > 500)
(commodity-buying-price stone < 200)
(can-buy-commodity stone)
=>
(chat-local-to-self "need stone")
(buy-commodity stone)
)
(defrule
(wood-amount < 225)
(gold-amount > 500)
(commodity-buying-price wood < 200)
(can-buy-commodity wood)
=>
(chat-local-to-self "need wood")
(buy-commodity wood)
)
(defrule
(food-amount < 200)
(gold-amount > 500)
(commodity-buying-price food < 200)
(can-buy-commodity food)
=>
(chat-local-to-self "need food")
(buy-commodity food)
)
;*******************************
;counterunits
;train specialty units
(defrule
(unit-type-count-total heavy-camel < 1)
(can-train heavy-camel)
(or
(or
(cc-players-unit-type-count any-enemy knight-line >= five-percent-pop)
(cc-players-unit-type-count any-enemy cavalry-archer-line >= five-percent-pop)
)
(or
(cc-players-unit-type-count any-enemy light-cavalry >= five-percent-pop)
(cc-players-unit-type-count any-enemy camel-line >= five-percent-pop)
)
)
=>
(train heavy-camel)
)
(defrule
(unit-type-count-total heavy-camel < 1)
(can-train heavy-camel)
(or
(or
(cc-players-unit-type-count any-enemy cataphract-line >= five-percent-pop)
(cc-players-unit-type-count any-enemy war-elephant-line >= five-percent-pop)
)
(or
(cc-players-unit-type-count any-enemy mameluke-line >= five-percent-pop)
(cc-players-unit-type-count any-enemy mangudai-line >= five-percent-pop)
)
)
=>
(train heavy-camel)
)
(defrule
(unit-type-count-total heavy-camel < five-percent-pop)
(can-train heavy-camel)
(or
(or
(cc-players-unit-type-count any-enemy knight-line >= ten-percent-pop)
(cc-players-unit-type-count any-enemy cavalry-archer-line >= ten-percent-pop)
)
(or
(cc-players-unit-type-count any-enemy light-cavalry >= ten-percent-pop)
(cc-players-unit-type-count any-enemy camel-line >= ten-percent-pop)
)
)
=>
(train heavy-camel)
)
(defrule
(unit-type-count-total heavy-camel < five-percent-pop)
(can-train heavy-camel)
(or
(or
(cc-players-unit-type-count any-enemy cataphract-line >= ten-percent-pop)
(cc-players-unit-type-count any-enemy war-elephant-line >= ten-percent-pop)
)
(or
(cc-players-unit-type-count any-enemy mameluke-line >= ten-percent-pop)
(cc-players-unit-type-count any-enemy mangudai-line >= ten-percent-pop)
)
)
=>
(train heavy-camel)
)
(defrule
(unit-type-count-total halberdier < 1)
(can-train halberdier)
(or
(or
(cc-players-unit-type-count any-enemy knight-line >= five-percent-pop)
(cc-players-unit-type-count any-enemy cavalry-archer-line >= five-percent-pop)
)
(or
(cc-players-unit-type-count any-enemy light-cavalry >= five-percent-pop)
(cc-players-unit-type-count any-enemy camel-line >= five-percent-pop)
)
)
=>
(train halberdier)
)
(defrule
(unit-type-count-total halberdier < 1)
(can-train halberdier)
(or
(or
(cc-players-unit-type-count any-enemy cataphract-line >= five-percent-pop)
(cc-players-unit-type-count any-enemy war-elephant-line >= five-percent-pop)
)
(or
(cc-players-unit-type-count any-enemy mameluke-line >= five-percent-pop)
(cc-players-unit-type-count any-enemy mangudai-line >= five-percent-pop)
)
)
=>
(train halberdier)
)
(defrule
(unit-type-count-total halberdier < five-percent-pop)
(can-train halberdier)
(or
(or
(cc-players-unit-type-count any-enemy knight-line >= ten-percent-pop)
(cc-players-unit-type-count any-enemy cavalry-archer-line >= ten-percent-pop)
)
(or
(cc-players-unit-type-count any-enemy light-cavalry >= ten-percent-pop)
(cc-players-unit-type-count any-enemy camel-line >= ten-percent-pop)
)
)
=>
(train halberdier)
)
(defrule
(unit-type-count-total halberdier < five-percent-pop)
(can-train halberdier)
(or
(or
(cc-players-unit-type-count any-enemy cataphract-line >= ten-percent-pop)
(cc-players-unit-type-count any-enemy war-elephant-line >= ten-percent-pop)
)
(or
(cc-players-unit-type-count any-enemy mameluke-line >= ten-percent-pop)
(cc-players-unit-type-count any-enemy mangudai-line >= ten-percent-pop)
)
)
=>
(train halberdier)
)
(defrule
(unit-type-count-total elite-skirmisher < 1)
(can-train elite-skirmisher)
(or
(or
(cc-players-unit-type-count any-enemy archer-line >= five-percent-pop)
(cc-players-unit-type-count any-enemy cavalry-archer-line >= five-percent-pop)
)
(or
(cc-players-unit-type-count any-enemy skirmisher-line >= five-percent-pop)
(cc-players-unit-type-count any-enemy hand-cannoneer >= five-percent-pop)
)
)
=>
(train elite-skirmisher)
)
(defrule
(unit-type-count-total elite-skirmisher < 1)
(can-train elite-skirmisher)
(or
(or
(cc-players-unit-type-count any-enemy longbowman-line >= five-percent-pop)
(cc-players-unit-type-count any-enemy chu-ko-nu-line >= five-percent-pop)
)
(or
(cc-players-unit-type-count any-enemy mangudai-line >= five-percent-pop)
(cc-players-unit-type-count any-enemy janissary-line >= five-percent-pop)
)
)
=>
(train elite-skirmisher)
)
(defrule
(unit-type-count-total elite-skirmisher < five-percent-pop)
(can-train elite-skirmisher)
(or
(or
(cc-players-unit-type-count any-enemy archer-line >= ten-percent-pop)
(cc-players-unit-type-count any-enemy cavalry-archer-line >= ten-percent-pop)
)
(or
(cc-players-unit-type-count any-enemy skirmisher-line >= ten-percent-pop)
(cc-players-unit-type-count any-enemy hand-cannoneer >= ten-percent-pop)
)
)
=>
(train elite-skirmisher)
)
(defrule
(unit-type-count-total elite-skirmisher < five-percent-pop)
(can-train elite-skirmisher)
(or
(or
(cc-players-unit-type-count any-enemy longbowman-line >= ten-percent-pop)
(cc-players-unit-type-count any-enemy chu-ko-nu-line >= ten-percent-pop)
)
(or
(cc-players-unit-type-count any-enemy mangudai-line >= ten-percent-pop)
(cc-players-unit-type-count any-enemy janissary-line >= ten-percent-pop)
)
)
=>
(train elite-skirmisher)
)
;***********************************
;walls
(defrule
(not (goal wall-build YES) )
=>
(set-goal wall-build NO)
)
(defrule
(goal wall-build YES)
(can-afford-complete-wall 2 stone-wall-line)
(can-build-wall-with-escrow 2 stone-wall-line)
=>
(release-escrow stone)
(build-wall 2 stone-wall-line)
)
(defrule
(goal wall-build YES)
(building-type-count-total gate < 4)
(can-build-gate-with-escrow 2)
=>
(release-escrow stone)
(build-gate 2)
)
(defrule
(goal wall-build YES)
(wall-completed-percentage 2 == 100)
=>
(set-goal wall-build NO)
(disable-self)
)
;***********************************
;towers
(defrule
(building-type-count-total castle > 1)
(building-type-count-total bombard-tower < 2)
(can-build bombard-tower)
(or
(goal wall-build NO)
(wall-completed-percentage 2 == 100)
)
=>
(build bombard-tower)
)
(defrule
(building-type-count-total castle > 1)
(building-type-count-total watch-tower-line < 2)
(can-build watch-tower-line)
(or
(goal wall-build NO)
(wall-completed-percentage 2 == 100)
)
=>
(build watch-tower-line)
)
(defrule
(building-type-count-total castle > 2)
(building-type-count-total bombard-tower < 5)
(can-build bombard-tower)
(or
(goal wall-build NO)
(wall-completed-percentage 2 == 100)
)
=>
(build bombard-tower)
)
(defrule
(building-type-count-total castle > 2)
(building-type-count-total watch-tower-line < 5)
(can-build watch-tower-line)
(or
(goal wall-build NO)
(wall-completed-percentage 2 == 100)
)
=>
(build watch-tower-line)
)
(defrule
(building-type-count-total castle > 3)
(can-build bombard-tower)
(or
(goal wall-build NO)
(wall-completed-percentage 2 == 100)
)
=>
(build bombard-tower)
)
(defrule
(building-type-count-total castle > 3)
(can-build watch-tower-line)
(or
(goal wall-build NO)
(wall-completed-percentage 2 == 100)
)
=>
(build watch-tower-line)
)
;**********************************************
;attack groups
(defrule
(goal wonder-attempt ATTACK)
=>
(enable-timer t-attackgroup 30)
(disable-self)
)
(defrule
(goal wonder-attempt ATTACK)
(timer-triggered t-attackgroup)
(population >= unit-max)
=>
(set-goal military-parity YES)
)
(defrule
(goal wonder-attempt ATTACK)
(timer-triggered t-attackgroup)
(or
(military-population >= twenty-percent-pop)
(or
(and
(players-military-population any-enemy < fifteen-percent-pop)
(military-population >= fifteen-percent-pop)
)
(and
(players-military-population any-enemy < ten-percent-pop)
(military-population >= ten-percent-pop)
)
)
)
=>
(set-goal military-parity YES)
)
(defrule
(goal military-parity YES)
(unit-type-count-total trebuchet == 0)
(unit-type-count-total battering-ram-line == 0)
(unit-type-count-total siege-onager == 0)
(unit-type-count-total bombard-cannon == 0)
(unit-type-count-total elite-tarkan < 10)
(unit-type-count-total petard < 3)
(military-population < twenty-percent-pop)
=>
(set-goal military-parity NO)
)
(defrule
(taunt-detected any-ally 201)
=>
(acknowledge-taunt this-any-ally 201)
(attack-now)
(chat-local-to-self "attack now!")
(set-goal military-parity YES)
)
(defrule
(goal military-parity YES)
=>
(set-strategic-number sn-percent-attack-soldiers 100)
(set-strategic-number sn-percent-attack-boats 100)
(attack-now)
(chat-to-player-using-id every-ally 22406) ;201
(chat-to-player-using-id any-human-ally 22117)
;"39 Attack now!"
)
(defrule
(goal military-parity NO)
(timer-triggered t-attackgroup)
(or
(or
(unit-type-count galley-line > 0)
(unit-type-count fire-ship-line > 0)
)
(or
(unit-type-count demolition-ship-line > 0)
(unit-type-count cannon-galleon-line > 0)
)
)
=>
(set-strategic-number sn-percent-attack-soldiers 0)
(set-strategic-number sn-percent-attack-boats 100)
(attack-now)
(chat-local-to-self "boats attack now")
)
(defrule
(goal military-parity NO)
(timer-triggered t-attackgroup)
(or
(unit-type-count turtle-ship-line > 0)
(unit-type-count longboat-line > 0)
)
=>
(set-strategic-number sn-percent-attack-soldiers 0)
(set-strategic-number sn-percent-attack-boats 100)
(attack-now)
(chat-local-to-self "boats attack now")
)
(defrule
(timer-triggered t-attackgroup)
=>
(set-goal military-parity NO)
(disable-timer t-attackgroup)
(enable-timer t-attackgroup 30)
)
(defrule
(goal wonder-attempt ATTACK)
=>
(set-strategic-number sn-special-attack-type3 1)
(disable-self)
)